package com.cfy.mybatis.spring.dao;

import com.cfy.mybatis.spring.domain.User;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import java.util.List;

public class UserDaoImpl extends SqlSessionDaoSupport implements UserDao{
    public User getUser(String userId) {
        return getSqlSession().selectOne("com.cfy.mybatis.spring.mapper.UserMapper.getUser",userId);

    }

    public void insertUserInfo(User userInfo) {
        getSqlSession().insert("com.cfy.mybatis.spring.mapper.UserMapper.insertUserInfo",userInfo);
    }

    public List<User> getUserTb() {
        return getSqlSession().selectList("com.cfy.mybatis.spring.mapper.UserMapper.getUsers");
    }
}
